package com.lucas.demo.abstractfactory;

import com.lucas.demo.factory.Shape;

/**
 * @author Lucas
 * @date 2021/7/28 下午5:17
 */
public abstract class AbstractFactory {

    public abstract Color getColor(String color);

    public abstract Shape getShape(String shape) ;

    public static AbstractFactory getFactory(String choice){
        if(choice.equalsIgnoreCase("SHAPE")){
            return new ShapeFactory();
        } else if(choice.equalsIgnoreCase("COLOR")){
            return new ColorFactory();
        }
        return null;
    }

}
